<!DOCTYPE html>
<html lang="en">

<head>
    <meta charset="UTF-8">
    <meta http-equiv="X-UA-Compatible" content="IE=edge">
    <meta name="viewport" content="width=device-width, initial-scale=1.0">
    <title>Document</title>
</head>

<body>
    <script>
        const object = {
            age: 18,
            name: '椿',
            address: '江西'
        }
        const newobject = {}
        function deepcopy(newobj, oldobj) {
            for (let k in oldobj) {
                newobj[k] = oldobj[k]
            }
        }
        deepcopy(newobject, object)
        newobject.age = 20
        console.log(newobject);
        console.log(object);

    </script>
</body>

</html>